var Main = function() {
	mui.init({
		swipeBack: false //启用右滑关闭功能
	});
	this.init();
	this.even();
	this.loadData();
};
Main.prototype = {
	init: function() {},
	even: function() {
		$('#btn-registerAccount').on('tap', function() {
			var telphone = $("#telphone").val();
			if(!telphone) {
				mui.toast('请输入手机号');
				return false;
			}
			if(!Verify.phone(telphone)) {
				mui.toast(Verify.phoneMsg);
				return false;
			}
			var truename = $("#truename").val();
			if(!truename) {
				mui.toast('请输入真实姓名');
				return false;
			}
			var idnum = $("#idnum").val();
			if(!idnum) {
				mui.toast('请输入身份证号');
				return false;
			}
			if(!Verify.idNum(idnum)) {
				mui.toast(Verify.idNumMsg);
				return false;
			}
			var url = server_url + "/pay/registerAndBindPay.do";
			var param = {
				"loginname": storage.loginname,
				"telphone": telphone,
				"truename": truename,
				"isMobile": isMobile,
				"cardcode": idnum,
				"accountid": storage.memberId
			}
			mui(this).button('loading');
			setTimeout(function() {
				mui(this).button('reset');
			}.bind(this), 5000);
			url = UrlHelper.customUrl(UrlHelper.urlEncode(param), url);
			url = encodeURIComponent(url);
			mui.openWindow({
				"url": "huifu.html?url=" + url + "&module=registerAccount",
				"id": "huifu-page"
			});
			/*window.open(url, '_system', 'location=yes');*/
		})
	},
	loadData: function() {
		$("#truename").val(!storage.truename ? "" : storage.truename);
		$("#telphone").val(storage.telphone);
		$("#idnum").val(storage.cardcode);
	}
};